package Basics;

public class 数组交换 {
    public static void main(String[] args) {
        int a[] = {1,2,3,4,5};
        for (int i = 0,j = a.length -1; i < j; i++,j--) {
            int temp = a[i];
            a[i] = a[j];
            a[j] = temp;
            System.out.println(a[i] + "" +a[j]);
        }
        for (int i = 0; i < a.length; i++) {
            System.out.print(a[i] + " ");
        }

    }
}
